/*******************************************************************************
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
function resetPassword(userId){
	 			createOverlayDlg("resetPassword",{
					title:'修改密码 ',
					width:500,
					height:400,
					buttons:{
						"确 定":function (){	
					var password=$("#password").val();
					var newpassword=$("#newpassword").val();
					var repswd=$("#repswd").val();
					var systemUserId=userId;
					
					$.ajax({
						 type: "post",
						  url: __ctxPath+"/admin/system/systemUsers.do?cmd=resetPw",
						  data:{password:password,newpassword:newpassword,repswd:repswd,systemUserId:systemUserId},
						  cache: false,
						  success: function(msg){
						    if(msg==0){
								alert('输入不正确！');
							}else if(msg==1){
							alert('原密码输入不正确！');
							}else if(msg==2){
							alert('两次输入密码不一致！');
							}else if(msg==3){
							alert('修改成功！');
							}
							
						  }
					  })
					$(this).dialog("close");
					},
						"取 消":function (){$(this).dialog("close");}
					},
					url:__ctxPath+"/admin/system/systemUsers.do?decorator=blank&cmd=resetSystemUserPW"
					
				});
	 		}